package com.triones.yjj.controller.web;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.triones.yjj.entity.AudioDO;
import com.triones.yjj.entity.bo.AudioBO;
import com.triones.yjj.entity.bo.BackCompareParams;
import com.triones.yjj.entity.bo.IndustryParams;
import com.triones.yjj.entity.vo.AudioVO;
import com.triones.yjj.entity.vo.BackCompareVO;
import com.triones.yjj.entity.vo.IndustryVO;
import com.triones.yjj.service.ToolService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 工具接口管理
 *
 * @Author: triones
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/activityTool")
public class ToolController extends BaseController {

    private final ToolService toolService;

    /**
     * 音频列表（分页）
     */
    @GetMapping("/music/pageList")
    public TableDataInfo<AudioVO> musicPageList(AudioBO bo, PageQuery pageQuery) {
        return toolService.musicPageList(bo,pageQuery);
    }

    /**
     * 添加音频
     */
    @PostMapping("/addMusic")
    public R<Void> addMusic(@RequestBody AudioDO dto) {
        return toAjax(toolService.addMusic(dto));
    }

    /**
     * 获取银行对照列表（分页）
     */
    @GetMapping("/backComparePageList")
    public TableDataInfo<BackCompareVO> backComparePageList(BackCompareParams params, PageQuery pageQuery) {
        return toolService.backComparePageList(params,pageQuery);
    }

    /**
     * 获取行业类别列表
     */
    @GetMapping("/industryList")
    public R<List<IndustryVO>> industryList(IndustryParams params) {
        return R.ok(toolService.industryList(params));
    }
}
